package com.m4f.business.service.ifc;

import java.io.IOException;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.util.List;

import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;
import com.m4f.business.model.AdditionalInformation;
import com.m4f.business.model.Company;
import com.m4f.business.model.Participant;
import com.m4f.business.service.exception.VideoNotRemovableException;
import com.m4f.business.service.helper.FormUploadInfo;
import com.m4f.video.exception.VideoNotFoundException;

public interface ICompanyService {
	
	/**
	 * 
	 * @param participant
	 * @return
	 * @throws Exception
	 */
	public Company addCompany(Participant participant) throws Exception;
	/**
	 * 
	 * @param participant
	 * @return
	 */
	public boolean existCompany(Participant participant);
	/**
	 * 
	 * @param company
	 * @param videoId
	 * @return
	 * @throws IOException
	 * @throws ServiceException
	 * @throws VideoNotFoundException
	 */
	public Company addVideoToCompany(Company company, String videoId) throws IOException, ServiceException, VideoNotFoundException;
	/**
	 * 
	 * @param company
	 * @throws IOException
	 * @throws ServiceException
	 * @throws VideoNotFoundException
	 */
	public void refreshCompanyVideoInformation(Company company) throws IOException, ServiceException, VideoNotFoundException;
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company validateCompany(Company company);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company blockCompany(Company company);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company preselectCompany(Company company);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company unPreselectCompany(Company company);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company finalistCompany(Company company);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company unFinalistCompany(Company company);
	/**
	 * 
	 * @param company
	 * @param additionalInformation
	 */
	public void addAdditionalInformation(Company company, AdditionalInformation additionalInformation);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public boolean removeCompany(Company company);
	/**
	 * 
	 * @param company
	 * @return
	 */
	public Company saveCompany(Company company);
	/**
	 * 
	 * @param participantEmail
	 * @return
	 */
	public Company getCompanyByParticipant(String participantEmail);
	/**
	 * 
	 * @param id
	 * @return
	 */
	public Company getCompanyById(Long id);
	/**
	 * 
	 * @return
	 */
	public List<Company> getAllCompanies();
	/**
	 * 
	 * @param validated
	 * @return
	 */
	public List<Company> getCompanies(Boolean validated);
	/**
	 * 
	 * @return
	 */
	public List<Company> getCompanies();
	/**
	 * 
	 * @return
	 */
	public boolean removeAllCompanies();
	/**
	 * 
	 * @return
	 */
	public List<Company> getPreselectedCompanies();
	/**
	 * 
	 * @return
	 */
	public List<Company> getFinalistCompanies();
	/**
	 * 
	 * @param company
	 * @return
	 * @throws ServiceException
	 * @throws IOException
	 */
	public FormUploadInfo getVideoUploadData(Company company) throws ServiceException, IOException;
	/**
	 * 
	 * @param company
	 * @param os
	 * @throws MalformedURLException
	 * @throws IOException
	 * @throws ServiceException
	 * @throws Exception
	 */
	public void downloadProjectSummaryDocument(Company company, OutputStream os) throws MalformedURLException, IOException, ServiceException, Exception;
	/**
	 * 
	 * @param company
	 * @param os
	 * @throws MalformedURLException
	 * @throws IOException
	 * @throws ServiceException
	 * @throws Exception
	 */
	public void downloadProjectSummaryPDF(Company company, OutputStream os)throws MalformedURLException, IOException, ServiceException, Exception;
	/**
	 * 
	 * @param company
	 * @param content
	 * @throws Exception
	 */
	public void updateProjectSummaryDocument(Company company, byte[] content) throws Exception;
	/**
	 * 
	 * @param company
	 * @return
	 * @throws IOException
	 * @throws ServiceException
	 */
	public boolean hasProjectSummaryDocument(Company company) throws IOException, ServiceException;
	/**
	 * 
	 * @param company
	 * @return
	 * @throws VideoNotRemovableException
	 * @throws IOException
	 * @throws ServiceException
	 */
	public Company deleteVideoFromCompany(Company company) throws VideoNotRemovableException, IOException, ServiceException;
	/**
	 * 
	 * @param company
	 * @throws MalformedURLException
	 * @throws AuthenticationException
	 * @throws IOException
	 * @throws ServiceException
	 */
	public void updateVideoInformation(Company company) throws MalformedURLException, AuthenticationException, IOException, ServiceException;
	/**
	 * 
	 * @param company
	 * @param errorCode
	 * @return
	 */
	public String getVideoUploadErrorMessage(Company company, int errorCode);
}